const fs = require('fs')
const path = require('path')

const file = path.join(__dirname, '../dist/index.html')
// 后台服务是一个前后台在一块项目，解决在后台中加载前端资源index.html中的title乱码问题
try {
  let htmlString = fs.readFileSync(file, { encoding: 'utf-8' })
  htmlString =
    '<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>' +
    htmlString
  fs.writeFileSync(file, htmlString, 'utf-8')
} catch (error) {
  console.log(error)
}
